package com.yytek.upgrade.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yytek.upgrade.mapper.UpgradeStrategyDeviceTopoMapper;
import com.yytek.upgrade.domain.UpgradeStrategyDeviceTopo;
import com.yytek.upgrade.service.IUpgradeStrategyDeviceTopoService;

/**
 * 升级策略设备关联Service业务层处理
 * 
 * @author yytek-iot
 * @date 2022-09-06
 */
@Service
public class UpgradeStrategyDeviceTopoServiceImpl implements IUpgradeStrategyDeviceTopoService 
{
    @Autowired
    private UpgradeStrategyDeviceTopoMapper upgradeStrategyDeviceTopoMapper;

    /**
     * 查询升级策略设备关联
     * 
     * @param strategyId 升级策略设备关联主键
     * @return 升级策略设备关联
     */
    @Override
    public List<UpgradeStrategyDeviceTopo> selectUpgradeStrategyDeviceTopoByStrategyId(Long strategyId)
    {
        return upgradeStrategyDeviceTopoMapper.selectUpgradeStrategyDeviceTopoByStrategyId(strategyId);
    }

    /**
     * 查询升级策略设备关联列表
     * 
     * @param upgradeStrategyDeviceTopo 升级策略设备关联
     * @return 升级策略设备关联
     */
    @Override
    public List<UpgradeStrategyDeviceTopo> selectUpgradeStrategyDeviceTopoList(UpgradeStrategyDeviceTopo upgradeStrategyDeviceTopo)
    {
        return upgradeStrategyDeviceTopoMapper.selectUpgradeStrategyDeviceTopoList(upgradeStrategyDeviceTopo);
    }

    /**
     * 新增升级策略设备关联
     * 
     * @param upgradeStrategyDeviceTopo 升级策略设备关联
     * @return 结果
     */
    @Override
    public int insertUpgradeStrategyDeviceTopo(UpgradeStrategyDeviceTopo upgradeStrategyDeviceTopo)
    {
        return upgradeStrategyDeviceTopoMapper.insertUpgradeStrategyDeviceTopo(upgradeStrategyDeviceTopo);
    }

    /**
     * 修改升级策略设备关联
     * 
     * @param upgradeStrategyDeviceTopo 升级策略设备关联
     * @return 结果
     */
    @Override
    public int updateUpgradeStrategyDeviceTopo(UpgradeStrategyDeviceTopo upgradeStrategyDeviceTopo)
    {
        return upgradeStrategyDeviceTopoMapper.updateUpgradeStrategyDeviceTopo(upgradeStrategyDeviceTopo);
    }

    /**
     * 批量删除升级策略设备关联
     * 
     * @param strategyIds 需要删除的升级策略设备关联主键
     * @return 结果
     */
    @Override
    public int deleteUpgradeStrategyDeviceTopoByStrategyIds(Long[] strategyIds)
    {
        return upgradeStrategyDeviceTopoMapper.deleteUpgradeStrategyDeviceTopoByStrategyIds(strategyIds);
    }

    /**
     * 删除升级策略设备关联信息
     * 
     * @param strategyId 升级策略设备关联主键
     * @return 结果
     */
    @Override
    public int deleteUpgradeStrategyDeviceTopoByStrategyId(Long strategyId)
    {
        return upgradeStrategyDeviceTopoMapper.deleteUpgradeStrategyDeviceTopoByStrategyId(strategyId);
    }

    /**
     * 批量绑定升级策略设备关联
     * @param topoList
     * @return
     */
    @Override
    public int insertUpgradeStrategyDeviceTopoList(List<UpgradeStrategyDeviceTopo> topoList) {
        return upgradeStrategyDeviceTopoMapper.batchUpgradeStrategyDeviceTopo(topoList);
    }

}
